home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / DB_CLIPP / 0327.ZIP / DBASE.H < prev    next >
Text File  |  1985-07-16  |  3KB  |  73 lines

  1. /*This header file must be included for any "C" program that uses any of the 
  2. DBASE "C" functions.*/
  3.  
  4. #define MAXFIELD        30      /*maximum fields per record*/
  5. #define MAXRECLEN       512     /*maximum record length in bytes*/
  6. #define MEMOMAX         2048    /*maximum memo field allowed to be read*/
  7.  
  8. /*DBASE header structure*/
  9. struct dbhead
  10.         {
  11.         char    db;             /*file flag*/
  12.         char    year;
  13.         char    month;
  14.         char    day;
  15.         long    quan;           /*number of records in file*/
  16.         int     idunno;         /*don't quite know what this is*/
  17.         int     reclgth;        /*number of bytes in record*/
  18.         char    misc[20];       /*other stuff*/
  19.         };
  20.  
  21. /*DBASE field structure*/
  22. struct dbfield
  23.         {
  24.         char name[11];          /*field name*/
  25.         char type;              /*field type*/
  26.         char guess[4];          /*your guess is as good as mine*/
  27.         char length;             /*field length*/
  28.         char decimal;           /*decimal positions if numeric*/
  29.         char other[13];         /*other stuff??*/
  30.         };
  31.  
  32. struct ndxhead                  /*index file header information*/
  33.         {
  34.         char dunno[18];         /*don't know what this is yet*/
  35.         int  xrecsize;          /*index file record size*/
  36.         char guess[4];          /*don't know what this is yet*/
  37.         char ndxflds[100];      /*fields indexed by the .NDX file*/
  38.         };
  39.  
  40. struct ndx                              /*index file informaton structure*/
  41.         {
  42.         char name[35];                  /*.NDX filename*/
  43.         int filenum;                    /*DOS file handle number*/
  44.         int fldnum;                    /*number of fields indexed in this file*/
  45.         int xrecsize;                   /*# of bytes of each index file record*/
  46.         char fields[MAXFIELD/3][11];    /*field names*/
  47.         };
  48.  
  49. struct dbinfo
  50.         {
  51.         int     error;       /*non-zero indicates error code & empty structure*/
  52.         char    filname[35];            /*file name*/
  53.         int     filenum;                /*.DBF file number for program use*/
  54.         int     ndxnum;                 /*number of index files with this .DBF*/
  55.         struct  ndx     ndxfile[10]; /*index file information - up to 10 files*/
  56.         int     dbtnum;                 /*.DBT file number for program use*/
  57.         struct  dbhead info;            /*file header information*/
  58.         int     fieldnum;               /*number of fields per record*/
  59.         struct  dbfield field[MAXFIELD];         /*field pointer*/
  60.         };
  61.  
  62. struct  cmemvar       /*character memory variable structure- 'cmem' is global*/
  63.         {
  64.         char    name[11];               /*memory variable name*/
  65.         char    c30f[2];                /*these 2 want to be 0xC3 & 0x0F*/
  66.                 /*true only for the first record of a .MEM file*/
  67.         char    null;                   /*null byte--00*/
  68.         char    d84d[2];                /*these 2 wants to be 0xD8 & 0x4D*/
  69.         char    size;                   /*size of character string*/
  70.         char    nulls[15];              /*15 null bytes*/
  71.         };
  72.  
  73.